﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aga.Psad.Backend.Entities;

namespace Aga.Psad.Backend.Repositories
{
    public class ImagenRepository : RepositoryBase<Imagen>
    {
        public List<Imagen> GetByDocumento(int documentoId)
        {
            var imagenes = DC.Imagens.Where(i => i.DocumentoId.Equals(documentoId));

            return imagenes.ToList();
        }

        public int GetCountByDocumento(int documentoId)
        {
            var table = DC.GetTable<Imagen>();

            int result = table.Where(i => i.DocumentoId.Equals(documentoId)).Count();

            return result;
        }
    }
}
